<template>
  <tr>
    <td>合计:</td>
    <td colspan="5">{{ sum }}</td>
  </tr>
</template>

<script>
export default {
  data() {
    return {}
  },
  props: ['goodListArr'],
  computed: {
    arr() {
      return this.goodListArr.map((item) => {
        if (item.checked == true) {
          return item.num * item.price
        } else {
          return 0
        }
      })
    },
    sum() {
      return this.arr.reduce((prec, item) => prec + item, 0)
    }
  }
}
</script>

<style lang="scss"></style>
